{template '_header'}

<div class="page-header">当前位置：<span class="text-primary">会员分组管理</span></div>
<div class="page-content">
<form action="./index.php" method="get" class="form-horizontal form-search" role="form">
    <input type="hidden" name="c" value="site" />
    <input type="hidden" name="a" value="entry" />
    <input type="hidden" name="m" value="mx_shop" />
    <input type="hidden" name="do" value="web" />
    <input type="hidden" name="r"  value="user.group" />
    <div class="page-toolbar">
        <div class="pull-left">
            {ifp 'user.group.add'}
            <a class='btn btn-primary btn-sm' data-toggle="ajaxModal" href="{php echo webUrl('user/group/add')}"><i class='fa fa-plus'></i> 添加会员分组</a>
            {/if}
        </div>
        <div class="pull-right col-md-6">
            <div class="input-group">
                <div class="input-group-select" style="display: none">
                    <select name="enabled" class='form-control'>
                        <option value="" {if $_GPC['enabled'] == ''} selected{/if}>状态</option>
                        <option value="1" {if $_GPC['enabled']== '1'} selected{/if}>启用</option>
                        <option value="0" {if $_GPC['enabled'] == '0'} selected{/if}>禁用</option>
                    </select>
                </div>
                <input type="text" class=" form-control" name='keyword' value="{$_GPC['keyword']}" placeholder="请输入关键词">
                <span class="input-group-btn">
                            <button class="btn btn-primary" type="submit"> 搜索</button>
                        </span>
            </div>
        </div>
    </div>
</form>

    {if empty($list)}
    <div class="panel panel-default">
        <div class="panel-body empty-data">未查询到相关数据</div>
    </div>
    {else}
    <table class="table table-hover table-responsive">
        <thead>
        <tr>
            <th style="width:25px;"></th>
            <th>分组名称</th>
            <th>会员数</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {loop $list $row}
        <tr {if $row['id']=='default'}style='background:#eee;{if !empty($_GPC['keyword'])}display:none;{/if}'{/if}>
        <td>

        </td>

        <td>{$row['groupname']}</td>
        <td>{$row['usercount']}</td>
        <td>
            {ifp 'user.list'}
            <a class='btn btn-default  btn-sm' href="{php echo webUrl('user/list', array('groupid' => $row['id']))}"><i class='fa fa-users'></i> 分组会员</a>
            {/if}
            {if $row['id']!='default'}
            {ifp 'user.group.edit'}
            <a data-toggle="ajaxModal" href="{php echo webUrl('user/group/edit', array('id' => $row['id']))}" class="btn btn-default btn-sm" ><i class='fa fa-edit'></i> 修改</a>
            {/if}

            {ifp 'user.group.delete'}
            <a data-toggle='ajaxRemove' href="{php echo webUrl('user/group/delete', array('id' => $row['id']))}"class="btn btn-default btn-sm" data-confirm='确认要删除此会员分组吗?'><i class="fa fa-trash"></i> 删除</a>
            {/if}
            {/if}

        </td>
        </tr>
        {/loop}

        </tbody>
    </table>
    {/if}

</div>
{template '_footer'}


